// ------------------------------------------------------------------
// Hack.ScreenCapturing.DirectX.Capture
//
// History:
//	2003-Jan-24		BL		- created
//
// Copyright (c) 2003 Brian Low
// ------------------------------------------------------------------

using System;
using System.Collections;
using System.Runtime.InteropServices;
using Hack.ScreenCapturing.DirectShowLib;
using System.Runtime.InteropServices.ComTypes;

namespace Hack.ScreenCapturing.DirectX.Capture
{
	/// <summary>
	///	 A collection of Filter objects (DirectShow filters).
	///	 This is used by the <see cref="Capture"/> class to provide
	///	 lists of capture devices and compression filters. This class
	///	 cannot be created directly.
	/// </summary>
	public class FilterCollection
	{
        protected DsDevice[] devs;

		/// <summary> Populate the collection with a list of filters from a particular category. </summary>
		internal FilterCollection(Guid category)
		{
            devs = DsDevice.GetDevicesOfCat(category);
        }

        /// <summary>
        /// Returns the number of elements
        /// </summary>
        public int Count
        {
            get
            {
                return devs.GetLength(0);
            }
        }

		/// <summary> Get the filter at the specified index. </summary>
		public Filter this[int index]
		{
			get { return( new Filter(devs[index])); }
		}
	}
}
